<extend name="Base/common" />
<block name="body">
	<!--导航引用-->
	<include file="Public/nav" />
	<footer class="ui-footer ui-footer-stable ui-btn-group ui-whitespace ui-border-t">
	</footer>
	<section class="ui-container">
		<form id="MyForm" action="{:U('apply_return')}" method="post">
			<div class="ui-form-item ui-border-b">
	            <label class="ui-border-r">开户名:</label>
	            <input type="text" name="name" id="name" placeholder="开户名" value="{$data.open_name|default=''}">
	        </div>
	        <div class="ui-form-item ui-border-b">
	            <label class="ui-border-r">开户银行:</label>
	            <input type="text" name="name" id="name" placeholder="开户银行" value="{$data.open_bank_name|default=''}">
	        </div>
	        <div class="ui-form-item ui-border-b">
	            <label class="ui-border-r">开户账号:</label>
	            <input type="text" name="name" id="name" placeholder="开户账号" value="{$data.bank_account|default=''}">
	        </div>
			<div class="ui-message-wrap">
				<textarea name="return_msg" id="return_msg" rows="4" cols="4" placeholder="请输入退货理由"></textarea>
				<div class="ui-btn-group">
					<input type="hidden" name="type" value="{$data.type}">
					<input type="hidden" name="order_id" value="{$data.order_id}">
					<input type="hidden" name="return_money" value="{$data.return_money}">
					<input type="hidden" name="cart_id" value="{$data.cart_id}">
					<a href="#" class="ui-btn" id="sureGoods">确定</a>
					<a href="javascript:history.go(-1);" class="ui-btn">取消</a>
				</div>
			</div>
		</form>
	</section>
</block>
<block name="script">
	<script type="text/javascript">
		$('#sureGoods').tap(function(){
			var obj = $('#MyForm'),
				return_msg = $('#return_msg').val();
			if(return_msg.length == 0){
				$.tips({
			        content:'退货理由不能为空！!',
			        stayTime:2000,
			        type:"success"
			    })
			}else{
				$.post(
					obj.attr('action'),
					obj.serialize(),
					function(r){
						if(r.status){
							$.tips({
						        content:'退货成功!',
						        stayTime:2000,
						        type:"success"
						    })
							window.location.href = r.url;
						}
					}, 
				'json');
			}
		});
	</script>
</block>